package com.action;

import java.util.List;
import java.util.Map;

import com.dao.Dao;
import com.mod.Product;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class DlAction extends ActionSupport{
	private String name;
	private String pwd;
	private Map<String, Object> session;
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPwd() {
		return pwd;
	}

	public void setPwd(String pwd) {
		this.pwd = pwd;
	}

	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		Dao dao = new Dao();
		if(dao.Dl(name, pwd)){
			List<Product> list = dao.show();
			session = ActionContext.getContext().getSession();
			session.put("plist", list);
			return "success";
			
		}
		return "false";
	}

}
